package net.udp;

import java.net.DatagramPacket;
import java.net.SocketException;

public class UDPEchoServer extends UDPSever
{
	public final static int DEFAULT_PORT = 7;
	public UDPEchoServer() throws SocketException
	{
		super(DEFAULT_PORT);
	}
	@Override
	public void respond(DatagramPacket request)
	{
		try
		{
			DatagramPacket outgoing = new DatagramPacket(request.getData(), request.getLength(),request.getAddress(),request.getPort());
			socket.send(outgoing);
		}
		catch (Exception e)
		{
		}
	}
	public static void main(String[] args)
	{
		try
		{
			UDPSever server = new UDPEchoServer();
			server.start();
		}
		catch (Exception e)
		{
		}
	}
	
}
